package com.ruoyi.system.domain;

import com.ruoyi.common.core.domain.BaseEntity;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * 供应商注册信息表
 */
public class SysVendor extends BaseEntity {

    private static final long serialVersionUID = -4143535332326656003L;

    /**
     * 定义两个2个空接口，用例标记参数校验规则
     */
    /**用于标记添加功能校验 */
    public interface AddGroup{};

    /**用于标记修改功能校验*/
    public interface UpdateGroup{};


    /**
     * 实体类信息
     */

    /** 供应商唯一识别号 */
    private Integer oid;

    /** 供应商名称 */
    @NotEmpty(message = "供应商名称不能为空", groups = {AddGroup.class})
    private String vendorName;

    /** 联系人姓名 */
    @NotEmpty(message = "联系人姓名不能为空", groups = {AddGroup.class})
    private String contactName;

    /** 联系人电话 */
    private String contactTel;

    /** 联系人手机 */
    @NotEmpty(message = "联系人手机不能为空", groups = {AddGroup.class})
    //@Pattern(regexp="^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$", message="手机号格式不正确")
    //^((13[0-9])|(17[0-1,6-8])|(15[^4,\\D])|(18[0-9]))\d{8}$/
    @Pattern(regexp="^((13[0-9])|(17[0-1,6-8])|(15[^4,\\D])|(18[0-9]))\\d{8}$", message="手机号格式不正确")
    private String contactPhone;

    /** 联系人电子邮箱 */
    @Email(message="邮箱格式不正确")
    @Pattern(regexp="^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", message="邮箱格式不正确")
    private String email;

    /** 主供产品类别 */
    private String mainProductCategor;

    /** 配套车型 */
    private String module;

    /** 注册日期 */
    private Date registerDate;

    /** 审核状态 */
    private String status;

    /** 供应商属性 */
    private String type;

    /** 查询排序列信息 */
    private String line;

    /** 供应商信息生效开始日期 */
    private Date effectiveDate;

    /** 供应商代码(正式或者临时)*/
    private String vendorNum;

    /** 注释*/
    private String note;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Integer getOid() {
        return oid;
    }

    public void setOid(Integer oid) {
        this.oid = oid;
    }

    public String getVendorName() {
        return vendorName;
    }

    public void setVendorName(String vendorName) {
        this.vendorName = vendorName;
    }

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getContactTel() {
        return contactTel;
    }

    public void setContactTel(String contactTel) {
        this.contactTel = contactTel;
    }

    public String getContactPhone() {
        return contactPhone;
    }

    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getMainProductCategor() {
        return mainProductCategor;
    }

    public void setMainProductCategor(String mainProductCategor) {
        this.mainProductCategor = mainProductCategor;
    }

    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    public Date getRegisterDate() {
        return registerDate;
    }

    public void setRegisterDate(Date registerDate) {
        this.registerDate = registerDate;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getLine() {
        return line;
    }

    public void setLine(String line) {
        this.line = line;
    }

    public Date getEffectiveDate() {
        return effectiveDate;
    }

    public void setEffectiveDate(Date effectiveDate) {
        this.effectiveDate = effectiveDate;
    }

    public String getVendorNum() {
        return vendorNum;
    }

    public void setVendorNum(String vendorNum) {
        this.vendorNum = vendorNum;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public SysVendor() {
    }

    public SysVendor(Integer oid, @NotEmpty(message = "供应商名称不能为空", groups = {AddGroup.class}) String vendorName, @NotEmpty(message = "联系人姓名不能为空", groups = {AddGroup.class}) String contactName, String contactTel, @NotEmpty(message = "联系人手机不能为空", groups = {AddGroup.class}) @Pattern(regexp = "^((13[0-9])|(17[0-1,6-8])|(15[^4,\\D])|(18[0-9]))\\d{8}$", message = "手机号格式不正确") String contactPhone, @Email(message = "邮箱格式不正确") @Pattern(regexp = "^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", message = "邮箱格式不正确") String email, String mainProductCategor, String module, Date registerDate, String status, String type, String line, Date effectiveDate, String vendorNum, String note) {
        this.oid = oid;
        this.vendorName = vendorName;
        this.contactName = contactName;
        this.contactTel = contactTel;
        this.contactPhone = contactPhone;
        this.email = email;
        this.mainProductCategor = mainProductCategor;
        this.module = module;
        this.registerDate = registerDate;
        this.status = status;
        this.type = type;
        this.line = line;
        this.effectiveDate = effectiveDate;
        this.vendorNum = vendorNum;
        this.note = note;
    }

    @Override
    public String toString() {
        return "SysVendor{" +
                "oid=" + oid +
                ", vendorName='" + vendorName + '\'' +
                ", contactName='" + contactName + '\'' +
                ", contactTel='" + contactTel + '\'' +
                ", contactPhone='" + contactPhone + '\'' +
                ", email='" + email + '\'' +
                ", mainProductCategor='" + mainProductCategor + '\'' +
                ", module='" + module + '\'' +
                ", registerDate=" + registerDate +
                ", status='" + status + '\'' +
                ", type='" + type + '\'' +
                ", line='" + line + '\'' +
                ", effectiveDate=" + effectiveDate +
                ", vendorNum='" + vendorNum + '\'' +
                ", note='" + note + '\'' +
                '}';
    }
}
